View Controller
Integration of MobaiBiometric ViewController with complete UI
Initialization and calling present of MBCaptureSessionViewController
let viewController = MBCaptureSessionViewController(options: .init())
viewController.delegate = self
self.present(viewController, animated: true, completion: nil)
Delegate
MBCaptureSessionVCDelegate
onSuccess is executed for MBCaptureSession class when the capture session is successfully finished @param result contains a list of frames.
func onSuccess(result: MBCaptureSessionResult) { }
onFailure is executed for MBCaptureSessionService class when the camera can not be @param error describes whether there is a camera or face failure
func onFailure(error: MBCaptureSessionError) { }
onPresentedDismissTapped is executed when the user close the screen from the X button
func onPresentedDismissTapped() { }
Options
Inside the library, we have some options for changing the behaviour of capturing data:
Variable Name | Type | Default Value |
---|---|---|
autoCaptureEnabled | boolean | true |
numberOfFramesBeforeCapture | number | 10 |
numberOfFrameToCollect | number | 5 |
frameInterval | number | 10 |
faceQualityEnabled | boolean | false |
timeBeforeAutomaticCapture | number | 4 |
isDebugging | boolean | false |
cameraPosition | CameraPostion | .front |
presentedDismissButtonEnabled | boolean | false |
targetResolutionPad | MBTargetResolution | .hd1920x1080 |
Description
- autoCaptureEnabled
- tells whether the capture is automatic or manual:
- Automatic: Automatically take an image with a specific time that you can configure with timeBeforeAutomaticCapture
- Manual: Manually take an image with the help of a button that the library shows
- tells whether the capture is automatic or manual:
- numberOfFramesBeforeCapture
- describes a number of the frame that the library capture before starting the process of capturing
- numberOfFrameToCollect
- describes the number of frames to collect during the capture session.
- frameInterval
- After collecting the first frame, is the number of frames to skip before collecting a frame.
- faceQualityEnabled
- to capture an image in a higher resolution
- timeBeforeAutomaticCapture
- number of seconds that the user needs to wait in automatic capture
- isDebugging
- it helps to check if constraints are working as expected
- for the moment, we provide debug text for face
- Too Far Away
- Too Close
- Too Far Up
- Too Far Down
- Too Far Left
- No Face Found
- Mouth Not Found
- Valid Face
- cameraPosition
- option to select the side of the camera|
- Front
- Back
- option to select the side of the camera|
- presentedDismissButtonEnabled
- option to add or remove the dismiss button at the top (This works only with the ViewController approach)
- targetResolutionPad
- option to change the resolution of the camera
If you have any questions, please contact .....